package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wfyn
 * @date 2023/10/5
 */

public interface DishFlavorMapper {
    /**
     *  根据菜品id查询菜品口味
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据菜品id删除菜品口味
     * @param dishId 菜品id
     */
    @Delete("DELETE FROM dish_flavor where dish_id=#{dishId}")
    void deleteByDishId(Long dishId);
    /**
     * 批量删除菜品口味
     * @param dishIds 菜品id
     */
    void deleteByDishIds(List<Long> dishIds);

    /**
     * 根据菜品id查询菜品口味列表
     * @param dishId 菜品id
     */
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
}
